﻿using Tao.OpenGl;
using Tao.Platform.Windows;

namespace proba_pera
{
    public class GraphicsCore
    {
        private SimpleOpenGlControl _control ;
        public GraphicsCore(SimpleOpenGlControl cntrl)
        {
            _control = cntrl;
        }

        public void SetColor(byte R, byte G, byte B)
        {
            Gl.glColor3f(R, G, B);
        }

        public void Rectangle(double x1, double y1, double x2, double y2)
        {
            Gl.glBegin(Gl.GL_LINE_LOOP);
            Gl.glVertex2d(x1, y1);
            Gl.glVertex2d(x1, y2);
            Gl.glVertex2d(x2, y2);
            Gl.glVertex2d(x2, y1);
            Gl.glEnd();
            Gl.glFlush();
        }
        
        public void Line(double x1, double y1, double x2, double y2)
        {
            Gl.glBegin(Gl.GL_LINE_STRIP);
            Gl.glVertex2d(x1, y1);
            Gl.glVertex2d(x1, y2);
            Gl.glEnd();
            Gl.glFlush();
        }


    }
}